<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body ng-app="myApp">
	<div ng-controller="myCtrl">
		<input type="text" ng-model="t">
		<test title="t">
			<p>{{title}}</p>
			<span>我的angularjs</span>
		</test>
	</div>
	<script src="http://cdn.bootcss.com/angular.js/1.6.6/angular.js"></script>
	<script type="text/javascript">
		var app = angular.module("myApp", [])
		app.controller("myCtrl", function($scope){
			$scope.logchore = "motorola"
		})
		app.directive('test', function() {
			return {
				'restrict':'E',
				scope:{
					title: "="
				}
			}
		})
	</script>
</body>
</html>